<?php
include_once 'utiles.php';

if(login_check() == true) {
	require_once("../phpGrid_Basic/conf.php");
	if (change_pass($_POST['oldp'], $_POST['newp'])) {
		logout();
		header('Location: login.php?error=3');
	} else {
		header('Location: main.php?pag=pass&error=1');
	}
} else {
	header('Location: login.php?error=2');
}
?>